package com.itheima.sh.service;

import com.itheima.sh.dao.UserMapper;
import com.itheima.sh.pojo.User;
import com.itheima.sh.util.SqlSessionUtil;
import org.apache.ibatis.session.SqlSession;

public class UserServiceImpl {
    public User login(User user) {
        SqlSession sqlSession = SqlSessionUtil.getSqlSession(false);
        UserMapper mapper = sqlSession.getMapper(UserMapper.class);
        User u = mapper.login(user);
        sqlSession.close();
        return u;
    }
}
